import { defHttp } from '/@/utils/http/axios';
import {
  IUpdatePrdFolder,
  IAddPrdFolder,
  IAddPrdFile,
  IUpdateBindingObjectList,
  IBorrowBdDataAddFile,
  IGetBorrowTableList,
  IGetFlowInstance,
  ICreatePicText,
} from './model/documentModel';
import { useGlobSetting } from '/@/hooks/setting';
const globSetting = useGlobSetting();

enum Api {
  UpdatePrdFolder = '/services/app/Prdfolder/UpdatePrdfolder',
  AddPrdFolder = '/services/app/Prdfolder/AddPrdfolder',
  // 添加目录关联文件
  AddPrdFile = '/services/app/Prdfolder/AddFolderAssociation',
  // 获取用户历史借阅审批流程数据
  GetBorrowBdData = '/services/app/WorkflowInstances/SelectBrowserHistroyWorkflow',
  // 获取对应文件相关流程实例
  GetFlowInstance = '/services/app/WorkflowInstances/SelectFileAboutWorkflow',
  // 导入文件类型
  ImportFileType = '/services/app/Pdmdoctype/GetALLFilePdmDocType',
  // 新建图文档
  CreatePicText = '/services/app/Task/AddFolderFile',
  // 图档类型
  GetFileType = '/services/app/Pdmdoctype/GetALLFilePdmDocTypeAndBd',
  // 目录权限角色
  GetUsersByFunRole = '/services/app/FunRoleUser/GetUsersByFunRole',
}
/**
 * 模块名:带用户权限的获取目录层级接口
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/02/01 14:43:53
 */
export const getDirectoryLevel = (superid?: number) =>
  defHttp.get({ url: `/services/app/Prdfolder/GetTestHavePower?superid=${superid}` });

/**
 * 模块名:新增目录数据
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/02/02 14:29:47
 */
export const addPrdFolder = (params: IAddPrdFolder) =>
  defHttp.post({ url: Api.AddPrdFolder, params });

/**
 * 模块名:修改目录数据
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/02/01 14:46:24
 */
export const updatePrdFolder = (params: IUpdatePrdFolder) =>
  defHttp.put({ url: Api.UpdatePrdFolder, params });

/**
 * 模块名:删除对应目录
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/02/01 14:59:04
 */
export const deletePrdFolder = (FolderId: string) =>
  defHttp.delete({ url: `/services/app/Prdfolder/DeleteOrAbolishedFolders?FolderId=${FolderId}` });

/**
 * 模块名:查看对应目录
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/02/04 09:47:40
 */
export const getPrdFolder = (FolderId: string) =>
  defHttp.get({ url: `/services/app/Prdfolder/GetOnePrdfolder?FolderId=${FolderId}` });

/**
 * 模块名:目录右键菜单里面加个添加图书馆索引
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/02/01 15:08:12
 */
export const addLibraryIndex = (PrdFolderId: number) =>
  defHttp.post({ url: `/services/app/Prdfolder/AddLibraryUsePrdId?PrdFolderId=${PrdFolderId}` });

/**
 * 模块名:检入
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/02/02 16:45:46
 */
export const checkIn = (OId: string) =>
  defHttp.post({ url: `/services/app/WorkflowInstances/JustCheckIn?OId=${OId}` });

/**
 * 模块名:检出
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/02/02 16:46:35
 */
export const checkOut = (OId: string) =>
  defHttp.post({ url: `/services/app/WorkflowInstances/JustCheckOut?OId=${OId}` });

/**
 * 模块名:撤销文件
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/02/02 16:47:36
 */
export const cancelFile = (OId: string) =>
  defHttp.post({ url: `/services/app/Prdfolder/RevokeFile?OId=${OId}` });

/**
 * 模块名:删除文件
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/02/02 16:48:39
 */
export const deleteFile = (OId: string) =>
  defHttp.delete({ url: `/services/app/Prdfolder/DeleteAllVersionFile?OId=${OId}` });

/**
 * 模块名:添加文件和图书馆索引数据
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/02/04 09:49:45
 */
export const addFileAndLibraryIndex = (params: IAddPrdFile) =>
  defHttp.post({ url: `/services/app/LibraryFile/AddLibraryFile`, data: params });

/**
 * 模块名:点击目录获取单文件列表
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/02/04 15:56:24
 */
export const getPrdFileList = (params: any) =>
  defHttp.get({ url: `/services/app/Prdfolder/GetPrdFileDatas`, params });

/**
 * 模块名:获取文件版本展示数据
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/02/05 11:22:34
 */
export const getPrdFileVersionList = (OId: string) =>
  defHttp.get({ url: `/services/app/Prdfolder/GetOneFileAllVersion?OId=${OId}` });

// 图文档下载
export const downloadFile = (OId: string, Version: string, fileName: string) =>
  defHttp.export(
    {
      url: `/DownloadFileHaveVersion`,
      data: { OId, Version },
    },
    fileName,
  );

// 图档打印
export const printFile = (oId: string, version: string) =>
  defHttp.post({
    url: `/Printfile`,
    data: { oId, version },
  });

// 获取对应文件详情信息
export const getPrdFileDetail = (OId: string) =>
  defHttp.get({ url: `/services/app/Prdfolder/GetOneFileDetails?OId=${OId}` });

// 查借阅表单目录
export const getBorrowTableList = (foldername: string) =>
  defHttp.get({ url: `/services/app/Prdfolder/GetTestUseName?foldername=${foldername}` });

// 获取对应目录绑定对象数据
export const getBindingObjectList = (Folderid: string, Flag: number) =>
  defHttp.get({
    url: `/services/app/Prdfolder/GetFolderDocTypeList?Folderid=${Folderid}&Flag=${Flag}`,
  });

// 修改对应目录与绑定文件类型列表数据
export const updateBindingObjectList = (params: IUpdateBindingObjectList) =>
  defHttp.post({ url: `/services/app/Prdfolder/ChangeFolderDocList`, data: params });

// 添加目录关联文件
export const addFolderBindingObject = (params: IBorrowBdDataAddFile) =>
  defHttp.post({ url: Api.AddPrdFile, data: params });

// 获取用户历史借阅审批流程数据
export const getHistoryBorrowApprovalList = (params: IGetBorrowTableList) =>
  defHttp.post({ url: Api.GetBorrowBdData, data: params });

/**
 * 模块名:获取对应文件相关流程实例
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/03/01 10:19:53
 */
export const getBorrowFlowInstance = (params: IGetFlowInstance) =>
  defHttp.post({ url: Api.GetFlowInstance, data: params });

/**
 * 模块名:导入文件,可多文件上传
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/03/04 09:40:40
 */
export const importFile = (DocType: string, DhType: string, FolderId: string, files: any) =>
  defHttp.post({
    url: `/services/app/Task/UploadFolderFile?DocType=${DocType}&DhType=${DhType}&FolderId=${FolderId}`,
    data: files,
  });

/**
 * 模块名:导入文件类型
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/03/04 10:48:48
 */
export const importFileType = () => defHttp.get({ url: Api.ImportFileType });

// 下载目录列表导出
export const downloadFolderList = (FolderId: string | number) =>
  defHttp.export({ url: `/DownloadTaskReportExcel`, data: FolderId }, '内容列表导出.xlsx');

/**
 * 模块名:相关图档列表
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/03/06 08:43:50
 */
export const getRelatedFileList = (OId: string) =>
  defHttp.get({ url: `/services/app/Prdfolder/GetOneFileAboutList?OId=${OId}` });

/**
 * 模块名:获取工作指派列表数据
 * 代码描述: OId为所选目录或文件idType 0为文件类型，1为目录类型
 * 作者:张泽源
 * 创建时间:2024/03/06 16:15:29
 */
export const getWorkAssignList = (OId: string, Type: string) =>
  defHttp.get({ url: `/services/app/Prdfolder/GetWorkHandOver?OId=${OId}&Type=${Type}` });

/**
 * 模块名:目录或单文件工作指派
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/03/06 16:21:31
 */
export const workAssign = (userid: string, fileList: any) =>
  defHttp.post({ url: `/services/app/Prdfolder/WorkHandOver`, data: { userid, fileList } });

/**
 * 模块名:查询所有图档类型数据(带类型分类图文档和表单)
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/03/07 16:45:13
 */
export const getAllFileType = (FolderId: number) =>
  defHttp.get({ url: Api.GetFileType, params: { FolderId } });

/**
 * 模块名:获取对应文件类型的基础详情数据
 * 代码描述:判断是文件类型的新建图档界面前调用
 * 作者:张泽源
 * 创建时间:2024/03/08 08:43:42
 */
export const getBaseDetail = (FileType: string | number) =>
  defHttp.get({ url: `/services/app/Task/GetFileThitObjectId?FileType=${FileType}` });

/**
 * 模块名:新建图文档（只能上传单个文件,可添加关联文件操作)
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/03/08 08:45:20
 */
export const createPictureDoc = (formData: any) =>
  defHttp.post({
    url: Api.CreatePicText,
    data: formData,
  });

/**
 * 模块名:浏览文件(根据oid和版本提取pdm存的对应文件,落地到服务器对应文件夹)
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/03/11 10:59:03
 */
export const browseFile = (OId: string, Version: number) =>
  defHttp.get({ url: `/services/app/Task/GetExtractFileUrl?OId=${OId}&Version=${Version}` });

/**
 * 模块名:获取对应图文档使用情况(零件和图档)列表
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/04/23 16:28:38
 */
export const GetDocTypeUseList = (params: any) =>
  defHttp.get({
    url: `/services/app/PartRevision/GetDocTypeUseList`,
    params,
  });

/**
 * 模块名: 获取对应文件类型和流程类型模板Dto列表
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/04/30 08:57:09
 */
export const getFileTypeAndFlowTypeTemplateList = (FileType: string, WorkflowType: string) =>
  defHttp.get({
    url: `/services/app/Workflows/GetWorkflowsListUseTypeRetDto?FileType=${FileType}&WorkflowType=${WorkflowType}`,
  });

/**
 * 模块名:新建图文档，为表单类型的动态数据
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/07/12 17:11:36
 */
export const GetBdInfoBeforeAdd = (FileType: string) =>
  defHttp.get({
    url: `/services/app/ClassProps/GetBdInfoBeforeAdd?FileType=${FileType}`,
  });

/**
 * 模块名:新建图档，类型为表单
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/07/31 09:03:39
 */
export const AddDocForm = (folderId: string, fileType: string, formData: any) =>
  defHttp.post({
    url: `/services/app/ClassProps/AddDocForm?folderId=${folderId}&fileType=${fileType}`,
    data: formData,
  });

/**
 * 模块名:
 * 代码描述: 查看表单实例
 * 作者:张泽源
 * 创建时间:2024/07/31 14:03:16
 */
export const OpenDocForm = (oid: string, typeName: string, version: string) =>
  defHttp.post({
    url: `/services/app/ClassProps/OpenDocForm?oid=${oid}&typeName=${typeName}&version=${version}`,
  });

/**
 * 模块名:修改表单实例
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/07/31 15:43:24
 */
export const EditDocForm = (typeName: string, formData: any) =>
  defHttp.post({
    url: `/services/app/ClassProps/EditDocForm?typeName=${typeName}`,
    data: formData,
  });

/**
 * 模块名:  目录权限角色
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/10/24 16:45:50
 */
export const GetFolderRoleList = () =>
  defHttp.get({
    url: Api.GetUsersByFunRole,
  });

/**
 * 模块名:目录归档
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/11/07 10:56:25
 */
export const ArchiveFolder = (folderId: string) =>
  defHttp.post({
    url: `/services/app/Prdfolder/ArchiveDirectory?folderId=${folderId}`,
  });

/**
 * 模块名:目录粘贴
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/11/07 11:25:38
 */
export function PasteResourceTaskUse(selectedFolderId: string, targetFolderId: string) {
  return defHttp.post({
    url: `/services/app/Prdfolder/CopyAndBindFolders?selectedFolderId=${selectedFolderId}&targetFolderId=${targetFolderId}`,
  });
}

/**
 * 模块名:目录权限生效
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/11/14 09:34:20
 */
export const UpdatePermissions = (
  direSelectData: any,
  userSelectData: any,
  operationSelectData: any,
) =>
  defHttp.put({
    url: `/services/app/TiPDMFolderPower/UpdatePermissions`,
    data: {
      direSelectData,
      userSelectData,
      operationSelectData,
    },
  });

/**
 * 模块名:目录权限单个查询接口
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/11/15 10:22:13
 */
export const ReverseParsePermissions = (userId: string, direId: string) =>
  defHttp.post({
    url: `/services/app/TiPDMFolderPower/ReverseParsePermissions?userId=${userId}&direId=${direId}`,
  });

/**
 * 模块名:权限类型绑定
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/11/18 16:37:47
 */
export const UpdatePermissionsType = (data: any) =>
  defHttp.put({
    url: `/services/app/TiPDMFileTypePower/UpdatePermissionsType`,
    data,
  });

/**
 * 模块名:根据目录id获取目录结构
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/11/22 11:57:37
 */
export const GetSelectedsonPrd = (superid: string) =>
  defHttp.get({
    url: `/services/app/Prdfolder/GetSelectedsonPrd?superid=${superid}`,
  });

/**
 * 模块名:获取表单以及图文档类型数据
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/11/25 11:29:32
 */
export const GetFormattedPdmdoctypes = () =>
  defHttp.get({
    url: `/services/app/Pdmdoctype/GetFormattedPdmdoctypes`,
  });

/**
 * 模块名:目录权限显示
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/11/27 16:17:55
 */
export const GetFolderPermissions = (direSelectData: any, userSelectData: any) =>
  defHttp.post({
    url: `/services/app/TiPDMFolderPower/GetFormattedPermissions`,
    data: {
      direSelectData,
      userSelectData,
    },
  });

/**
 * 模块名:类型权限显示
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/12/03 15:43:22
 */
export const GetFileTypePermissions = (typeSelectData: any, userSelectData: any) =>
  defHttp.post({
    url: `/services/app/TiPDMFileTypePower/GetFormattedPermissions`,
    data: {
      typeSelectData,
      userSelectData,
    },
  });

/**
 * 模块名:目录显示导出excel
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/12/04 08:39:31
 */
export const ExportPermissionsToExcel = (
  exportFileName: any,
  direSelectData: any,
  userSelectData: any,
) =>
  defHttp.export(
    {
      url: `/ExportPermissionsToExcel?exportFileName=${exportFileName}`,
      data: {
        direSelectData,
        userSelectData,
      },
    },
    exportFileName,
  );

/**
 * 模块名:获取权限id和权限名
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/12/05 11:31:02
 */
export const ReversesActivatePower = (direSelectData: any, userSelectData: any) =>
  defHttp.post({
    url: `/services/app/TiPDMFolderPower/ReverseActivatePower`,
    data: {
      direSelectData,
      userSelectData,
    },
  });

/**
 * 模块名:根据用户id获取文件类型
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/12/06 11:10:16
 */
export const GetFileTypeByUserId = (userId: string) =>
  defHttp.get({
    url: `/services/app/TiPDMFileTypePower/GetPdmdoctypesWithPermissions?userId=${userId}`,
  });

/**
 * 模块名:查询发布文档
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/12/26 13:24:18
 */
export const GetPdmObjReleases = (params: any) =>
  defHttp.get({
    url: `/services/app/PdmObjRelease/GetPdmObjReleases`,
    params,
  });

/**
 * 模块名:获取发布文档历史版本
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/12/26 14:00:33
 */
export const GetReleaseFileVersion = (OId: string) =>
  defHttp.get({
    url: `/services/app/Prdfolder/GetReleaseFileVersion?OId=${OId}`,
  });

/**
 * 模块名:获取操作日志
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/12/26 14:01:13
 */
export const GetOpreationAct = (OId: string) =>
  defHttp.get({
    url: `/services/app/PdmObjReleaseTemp/GetOpreationAct?OId=${OId}`,
  });

/**
 * 模块名:图档废止区查询功能
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2024/12/30 11:31:40
 */
export const GetPdmObjRecycles = (params: any) =>
  defHttp.get({
    url: `/services/app/PdmDocmaster/GetPdmAbolishDocmastersDatas`,
    params,
  });

/**
 * 模块名:走废止流程前判断
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2025/01/02 09:24:37
 */
export const JudgeAbolishedDocData = (oid: string) =>
  defHttp.post({
    url: `/services/app/PdmDocmaster/JudgeAbolishedDocData?oid=${oid}`,
  });

/**
 * 模块名:废止区图档删除
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2025/01/02 11:17:05
 */
export const DeleteAbolishedDoc = (oids: any) =>
  defHttp.post({
    url: `/services/app/PdmDocmaster/DeleteAbolishedDocs`,
    data: {
      oids,
    },
  });

/**
 * 模块名:废止区文档恢复
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2025/01/02 11:18:00
 */
export const RestoreAbolishedDoc = (oids: any, userSelectPrdId: string) =>
  defHttp.post({
    url: `/services/app/PdmDocmaster/RestoreAbolishedDoc`,
    data: {
      oids,
      userSelectPrdId,
    },
  });

/**
 * 模块名:查看文件的流程实例
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2025/01/03 09:16:05
 */
export const SelectFileAboutWorkflow = (oId: string, version: number) =>
  defHttp.post({
    url: `/services/app/WorkflowInstances/SelectFileAboutWorkflow`,
    data: {
      oId,
      version,
    },
  });

/**
 * 模块名:autoView预览
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2025/01/09 11:19:15
 */
export const ExtractFileByAutoView = (oid: string, version: number) =>
  defHttp.post({
    url: `/services/app/PdmDocmaster/ExtractFileByAutoView?oid=${oid}&version=${version}`,
  });

/**
 * 模块名:autoView比较预览
 * 代码描述: type 普通的图文档就传0 如果是零件下挂的传1
 * 作者:张泽源
 * 创建时间:2025/01/09 13:52:10
 */
export const ExtractManyFileByAutoView = (params: any) =>
  defHttp.post({
    url: `/services/app/PdmDocmaster/ExtractManyFileByAutoView`,
    data: params,
  });

/**
 * 模块名:全局设置预览方式接口
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2025/01/13 10:25:58
 */
export const CreatePreviewSetting = (previewTypeId: string, PreviewType: string) =>
  defHttp.post({
    url: `/services/app/Task/CreatePreviewSetting?previewTypeId=${previewTypeId}&PreviewType=${PreviewType}`,
  });

/**
 * 模块名:查询全局设置预览方式接口
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2025/01/13 10:27:52
 */
export const GetPreviewSettings = () =>
  defHttp.get({
    url: `/services/app/Task/GetPreviewSettings`,
  });

/**
 * 模块名:收回发布图档时显示对应数据
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2025/01/15 15:00:51
 */
export const GetPdmObjReleasedDoc = (oid: string) =>
  defHttp.get({
    url: `/services/app/PdmObjRelease/GetPdmObjReleasedDoc?oid=${oid}`,
  });

/**
 * 模块名:收回发布的文档
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2025/01/15 15:02:08
 */
export const DeletePublishedDoc = (params: any) =>
  defHttp.post({
    url: `/services/app/PdmObjRelease/DeletePublishedDoc`,
    data: params,
  });

/**
 * 模块名:表单渲染接口
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2025/01/16 09:15:30
 */
export const GetBrowserData = (docType: string) =>
  defHttp.get({
    url: `/services/app/Pdmdoctype/GetBrowserData?docType=${docType}`,
  });

/**
 * 模块名:目录文件导出
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2025/01/16 15:20:55
 */
export const DownloadAllFilesAsBinary = (containerId: string, fileName: string) =>
  defHttp.export(
    {
      url: `/DownloadAllFilesAsBinary?containerId=${containerId}`,
    },
    fileName,
  );

/**
 * 模块名:目录归档
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2025/01/22 16:32:18
 */
export const ArchiveDirectory = (DirectoryId: number) =>
  defHttp.post({
    url: `/services/app/Prdfolder/ArchiveDirectory?DirectoryId=${DirectoryId}`,
  });

/**
 * 模块名:新建图文档表单属性自动填充
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2025/01/23 13:45:46
 */
export const GetPdmDocAttributeData = (doctype: string) =>
  defHttp.get({
    url: `/services/app/PdmDocmaster/GetPdmDocAttributeData?doctype=${doctype}`,
  });

/**
 * 模块名:图文当修改接口
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2025/01/24 10:11:20
 */
export const UpdateFileDetails = (params: any) =>
  defHttp.put({
    url: `/services/app/PdmDocmaster/UpdateFileDetails`,
    data: params,
  });

/**
 * 模块名:解除归档目录下绑定的目录
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2025/02/21 13:45:46
 */
export const UnbindAchieveDirectory = (folderId: number, targetFolderId: number) =>
  defHttp.post({
    url: `/services/app/Prdfolder/UnbindAchieveDirectory?folderId=${folderId}&targetFolderId=${targetFolderId}`,
  });

/**
 * 模块名:查询目录所在位置
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2025/02/24 15:28:13
 */
export const SelectPrdForFiles = (oid: string) =>
  defHttp.post({
    url: `/services/app/Prdfolder/SelectPrdForFiles?oid=${oid}`,
  });

/**
 * 模块名:按文件夹导入
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2025/03/11 09:02:07
 */
export const UploadFolderFileByFolders = (
  DocType: string,
  DhType: string,
  FolderId: string,
  files: any,
) =>
  defHttp.post({
    url: `/services/app/Task/UploadFolderFileByFolders?DocType=${DocType}&DhType=${DhType}&FolderId=${FolderId}`,
    data: files,
  });

/**
 * 模块名:表单下载
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2025/03/20 14:30:25
 */
export const DownloadWriteBackBdData = (oid: string, fileName: string) =>
  defHttp.export(
    {
      url: `/DownloadWriteBackBdData?oid=${oid}`,
    },
    fileName,
  );

/**
 * 模块名:判断是否在流程中的接口
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2025/03/29 14:38:00
 */
export const GetIsInWorkflow = (oid: string) =>
  defHttp.post({
    url: `/services/app/WorkflowInstances/IsNotHaveExistWorkflow?oid=${oid}`,
  });

/**
 * 模块名:获取流程实例信息
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2025/04/08 16:20:40
 */
export const GetWorkflowinsDetailsInfo = (StepInsId: string, WfInsId: string, OId: string) =>
  defHttp.get({
    url: `/services/app/Task/GetWorkflowinsDetailsInfo?StepInsId=${StepInsId}&WfInsId=${WfInsId}&OId=${OId}`,
  });

/**
 * 模块名:修改流程实例信息
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2025/04/08 16:38:56
 */
export const UpdateObjectList = (params: any) =>
  defHttp.put({
    url: `/services/app/Task/UpdateObjectList`,
    data: params,
  });

/**
 * 模块名:发布图档新增功能
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2025/04/15 16:00:13
 */
export const GetPublishFileMsg = (params: any) =>
  defHttp.get({
    url: `/services/app/PdmObjReleaseTemp/GetPublishFileMsg`,
    params: params,
  });

/**
 * 模块名:onlyoffice获取配置项
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2025/04/18 14:56:41
 */
export const GetOnlyOfficeConfig = (oid: string, version: string, userId: string, mode: string) =>
  defHttp.get({
    url: `/services/app/OnlyOfficeService/GetConfig?oid=${oid}&version=${version}&userId=${userId}&mode=${mode}`,
  });

/**
 * 模块名:图档共享
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2025/04/25 16:19:52
 */
export const AddEditingRecord = (params: any) =>
  defHttp.post({
    url: `/services/app/Task/AddEditingRecord`,
    data: params,
  });

/**
 * 模块名:共享区列表查询
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2025/04/28 09:43:32
 */
export const GetDocEditRecord = (params: any) =>
  defHttp.get({
    url: `/services/app/DocCollaborativeEdit/GetDocEditRecord`,
    params: params,
  });

/**
 * 模块名:删除快捷方式
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2025/05/23 11:36:06
 */
export const DeleteFolderShortCut = (folderId: string, oid: string) =>
  defHttp.delete({
    url: `/services/app/Prdfolder/DeleteFolderShortCut?folderId=${folderId}&oid=${oid}`,
  });
